Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openmaps-auth-3.10.9
11 changes: 11 additions & 0 deletions openmaps_auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ def create_user(self, email, password=None, **extra_fields):
extra_fields.setdefault("is_superuser", False)
return self._create_user(email, password, **extra_fields)

def create_superuser(self, email, password=None, **extra_fields):
extra_fields.setdefault("is_staff", True)
extra_fields.setdefault("is_superuser", True)

if extra_fields.get("is_staff") is not True:
raise ValueError("Superuser must have is_staff=True.")
if extra_fields.get("is_superuser") is not True:
raise ValueError("Superuser must have is_superuser=True.")

return self._create_user(email, password, **extra_fields)

def _create_user(self, email, password, **extra_fields):
if not email:
raise ValueError("The given email address must be set")
Expand Down
2 changes: 1 addition & 1 deletion openmaps_auth/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
OPENMAPS_AUTH_BACKEND = env.str("OPENMAPS_AUTH_BACKEND", default=None)
if OPENMAPS_AUTH_BACKEND:
OPENMAPS_AUTH_SECRET = env.str("OPENMAPS_AUTH_SECRET", default="")
OPENMAPS_AUTH_TITLE = env.str("OPENMAPS_AUTH_TITLE", default="Maxar OpenMaps")
OPENMAPS_AUTH_TITLE = env.str("OPENMAPS_AUTH_TITLE", default="VantorMaps")
OPENMAPS_AUTH_APP_LINKS = env.json(
"OPENMAPS_AUTH_APP_LINKS", default=[{"link": "/", "text": "MapEdit"}]
)
Expand Down
35 changes: 35 additions & 0 deletions openmaps_auth/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,38 @@

DEBUG = True
LOGGING["loggers"]["openmaps_auth"]["level"] = "DEBUG" # noqa: F405

# Development app links with descriptions for testing
OPENMAPS_AUTH_APP_LINKS = [
{
"link": "/",
"text": "MapEdit",
"description": "Web-based mapping application that allows users to contribute and maintain vector data all over the world using high-resolution imagery.",
},
{
"link": "/josm/",
"text": "JOSM",
"description": "Java OpenStreetMap Editor is a desktop application for editing OpenStreetMap.",
},
{
"link": "/geoserver/",
"text": "GeoServer",
"description": "GeoServer is an open source server for sharing geospatial data.",
},
{
"link": "/hootenanny/",
"text": "Hootenanny",
"description": "Hootenanny is a web-based application for editing OpenStreetMap data.",
},
{
"link": "/certs/",
"text": "Certificates",
"description": "Manage your client certificates.",
},
{"link": "/exports/", "text": "Export Tool", "description": "Tools for exporting."},
{
"link": "/overpass/",
"text": "Overpass Turbo",
"description": "Overpass Turbo is a web-based application for querying OpenStreetMap data.",
},
]
8 changes: 5 additions & 3 deletions openmaps_auth/social/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from social_core.utils import slugify

logger = logging.getLogger(__name__) # noqa
logger = logging.getLogger(__name__) # noqa


class LoginGovOpenIdConnect(OpenIdConnectAuth):
Expand Down Expand Up @@ -62,8 +62,10 @@ def generate_client_secret(self):
"jti": secrets.token_urlsafe(32),
"exp": now + self.TOKEN_TTL_SEC,
}
logger.error("Hereeeeeeeeee generate_client_secret ------>") # noqa
logger.error(jwt.encode(payload, key=private_key, algorithm=self.JWT_ALGORITHMS[0])) # noqa
logger.error("Hereeeeeeeeee generate_client_secret ------>") # noqa
logger.error(
jwt.encode(payload, key=private_key, algorithm=self.JWT_ALGORITHMS[0])
) # noqa
return jwt.encode(payload, key=private_key, algorithm=self.JWT_ALGORITHMS[0])

def get_key_and_secret(self):
Expand Down
75 changes: 63 additions & 12 deletions openmaps_auth/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ body {
width: 100%;
margin: 0 auto;
font-family: Arial, sans-serif;
overflow-x: hidden;
}
a {
font-size: 1.5rem;
Expand Down Expand Up @@ -400,19 +401,20 @@ fieldset {
align-items: center;
}
.footer_container {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: center;
width: 100%;
position: sticky;
bottom: 1px;
left: 0px;
right: 0px;
margin-bottom: 0px;
left: 0px;
width: 100%;
margin: 0;
padding: 8px 0;
background: var(--hub-bg, #1d1d1d);
color: #fff;
z-index: 5;
background-color: #ffffff;
}
.footer_container p { color: #fff; }
.form_align {
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -496,10 +498,6 @@ hr {
a.image_holder.app_img.img_container.size.underline:hover {
color: #000000;
}
.maxar_logo {
color: #fcaf17;
font-size: 20px;
}
.hide-icon {
height: 0px;
width: 0px;
Expand Down Expand Up @@ -551,3 +549,56 @@ ul.messagelist li.error {
background: #ffefef url(../img/icon-no.svg) 40px 12px no-repeat;
background-size: 16px auto;
}


/* TWK Everett Font */
@font-face{font-family:'TWK Everett';src:url('../fonts/TWKEverett-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'TWK Everett';src:url('../fonts/TWKEverett-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap;}

/* Vantor Hub-like unauthenticated landing styles */
:root { --hub-purple:#A855F7; --hub-aqua:#28EAE4; --hub-bg:#1d1d1d; --hub-card:#2a2a2a; --hub-text:#E5E7EB; --hub-muted:#A3A3A3; }
.hub-landing{min-height:100vh;display:flex;align-items:center;justify-content:center;background:var(--hub-bg);padding:2rem;position:relative;}
.hub-brand{position:absolute;top:24px;left:24px;display:block;}
.hub-brand img{height:28px;width:auto;opacity:.95;}
.hub-card{width:520px;max-width:92%;background:var(--hub-card);border:1px solid rgba(168,85,247,.45);border-radius:12px;padding:36px 32px;text-align:center;color:var(--hub-text);box-shadow:0 10px 30px rgba(0,0,0,.5);font-family:'TWK Everett',ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;}
.hub-card h1{margin:0 0 14px;font-size:26px;color:var(--hub-text);font-weight:500;}
.hub-card p{margin:0 0 22px;color:var(--hub-muted);font-weight:400;}
.hub-primary-button{width:100%;box-sizing:border-box;border:2px solid var(--hub-purple);color:var(--hub-purple);background:transparent;padding:.95rem 1.2rem;font-size:1.5rem;font-weight:500;border-radius:8px;text-align:center;display:block;float:none;cursor:pointer;text-decoration:none;transition:background-color .2s ease,color .2s ease;font-family:inherit;-webkit-appearance:none;appearance:none;}
.hub-primary-button:hover{background:var(--hub-purple);color:#fff;}
.hub-card form{margin-top:6px;text-align:left;}
.hub-card label{display:block;margin:12px 0 6px;color:var(--hub-muted);}
.hub-card input[type="text"], .hub-card input[type="password"]{width:100%;box-sizing:border-box;border-radius:8px;padding:.8rem .9rem;border:1px solid #2B2B32;background:#0E0E14;color:var(--hub-text);}

/* Vantor Hub-like authenticated menu styles */
.hub-menu{min-height:100vh;background:var(--hub-bg);padding:0 0 80px 0;position:relative;font-family:'TWK Everett',ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;overflow-x:hidden;}
.hub-menu .hub-brand{position:absolute;top:24px;left:24px;z-index:10;}
.hub-menu .hub-user{position:absolute;top:24px;right:24px;color:var(--hub-text);font-size:14px;display:flex;gap:16px;align-items:center;font-weight:400;z-index:10;}
.hub-menu .hub-user a{color:var(--hub-aqua);text-decoration:none;font-size:14px;padding:6px 14px;border:1px solid var(--hub-aqua);border-radius:6px;transition:all .2s ease;display:inline-block;float:none;font-weight:400;}
.hub-menu .hub-user a:hover{background:var(--hub-aqua);color:#000;}
.hub-menu .hub-welcome-banner{width:100%;background:var(--hub-card);padding:3rem 2rem;text-align:center;margin-top:80px;margin-bottom:0;box-sizing:border-box;}
.hub-menu .hub-welcome-banner h1{color:var(--hub-text);font-size:40px;font-weight:500;margin:0;text-transform:uppercase;text-shadow:none;letter-spacing:0.5px;}
.hub-menu .hub-menu-content{margin-top:0;padding:2rem;display:flex;flex-direction:column;align-items:center;}
.hub-menu .hub-menu-title{text-align:center;margin-top:3rem;margin-bottom:0;width:100%;display:flex;flex-direction:column;align-items:center;min-height:145px;}
.hub-menu .hub-menu-title h1{color:var(--hub-text);font-size:32px;font-weight:500;margin:0 0 16px;text-transform:none;text-shadow:none;}
.hub-menu .hub-menu-title .hover_text{color:#fff;font-size:16px;margin:0 auto 0;font-weight:400;height:77px;max-width:800px;line-height:1.6;display:flex;align-items:center;justify-content:center;padding:0 1rem;flex-shrink:0;width:100%;box-sizing:border-box;overflow:visible;}
.hub-menu .hub-message-container{width:100%;display:flex;justify-content:center;margin-bottom:1.5rem;}
.hub-menu .center_section{display:flex;align-items:center;justify-content:center;flex-direction:column;}
.hub-menu .section{display:grid;grid-template-rows:repeat(3,240px);grid-template-columns:repeat(3,240px);grid-column-gap:20px;grid-row-gap:20px;margin:0 auto 2rem;justify-content:center;}
.hub-menu .container_spacing{margin:0;transition:transform .2s ease;}
.hub-menu .container_spacing:hover{transform:scale(1.04);}
.hub-menu article{background:var(--hub-card);border:1px solid rgba(40,234,228,.25);border-radius:12px;transition:all .2s ease;height:100%;width:100%;}
.hub-menu article:hover{border-color:var(--hub-aqua);box-shadow:0 8px 24px rgba(0,0,0,.45);}
.hub-menu .app_card{background:transparent;color:var(--hub-text);height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 16px 24px;}
.hub-menu .show-icon{filter:invert(1) brightness(1.1);box-shadow:none;fill:var(--hub-text);}
.hub-menu .underline{color:var(--hub-text);text-decoration:none;font-weight:500;font-size:16px;text-decoration-color:transparent;justify-content:center;margin-top:12px;}
.hub-menu .underline:hover{color:#fff;}
/* Success message banner styling for authenticated menu */
.hub-menu ul.messagelist{padding:0;margin:0;list-style:none;width:100%;max-width:600px;display:flex;justify-content:center;}
.hub-menu ul.messagelist li{display:block;font-weight:400;font-size:14px;padding:12px 40px 12px 40px;margin:0;color:#fff;border-radius:8px;position:relative;border:none;background:transparent;text-align:center;}
.hub-menu ul.messagelist li::before{content:'';position:absolute;left:8px;top:50%;transform:translateY(-50%);width:24px;height:24px;background:var(--hub-aqua);border-radius:50%;z-index:1;}
.hub-menu ul.messagelist li::after{content:'';position:absolute;left:8px;top:50%;transform:translateY(-50%);width:24px;height:24px;background:url(../img/icon-yes.svg) center center no-repeat;background-size:14px auto;z-index:2;filter:brightness(0) invert(1);}
.hub-menu ul.messagelist li.warning::before{background:#fbbf24;}
.hub-menu ul.messagelist li.warning::after{background-image:url(../img/icon-alert.svg);background-size:13px auto;filter:brightness(0) invert(1);}
.hub-menu ul.messagelist li.error::before{background:#ef4444;}
.hub-menu ul.messagelist li.error::after{background-image:url(../img/icon-no.svg);background-size:14px auto;filter:brightness(0) invert(1);}

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion openmaps_auth/static/img/icon-yes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions openmaps_auth/static/img/vantor_h_w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions openmaps_auth/static/img/vantor_symbol_w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading