npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fle-ember-addon-data

v1.0.0-release.39

Published

Finish Line Events shared Ember-Data models.

Downloads

8

Readme

Finish Line Events - Ember Addon Data

Ember Test

This addon is responsible for providing data access and authentication to Finish Line Events applications.

How Does Authentication Work

Please refer to the Planning repository's document on Authentication.

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install fle-ember-addon-data

Usage

Authentication

Ember Simple Auth (ESA) has been included with this application is automatically configured to authenticate with AWS Cognito.

Configuration

For the production edition of the application using this addon for authentication, the redirect URIs for signing in and signing out must be configured.

Inside the application's config/environment.js, the following section should be added to the production environment and the url to the Ember SPA being deploy to prodcution should be used (replace the [...] in the code below):

if (environment === 'production') {
  ENV.APP['ember-simple-auth-aws-amplify'] = {
    ...ENV.APP['ember-simple-auth-aws-amplify'],
    awsAmplifyAuth: {
      config: {
        oauth: {
          redirectSignIn: 'https://[...].finishline.events/oauth',
          redirectSignOut: 'https://[...].finishline.events/oauth'
        }
      }
    }
  };
}

NOTE do not forget that AWS Cognito will need to be updated to accomodate and accept the production edition URL that is specified in the configuration.

The session Service

This addon ships with an enhanced Ember Simple Auth SessionService that includes alias-properties that fetch token payload data and also answer questions about the role the user belongs to.

To enable this custom FleSessionService, the session service must be created in the application using this addon:

./node_modules/.bin/ember g service session

And then extend the SessionService from this addon:

// app/services/session.js

import FleSession from 'fle-ember-addon-data/services/fle-session';

export default class SessionService extends FleSession {}

Injecting The session Automatically

For convenience sake, the session service can automatically be added to specific scopes using and initializer. To configure this initializer to be added to the session service to all controllers and routes, you can do the following:

./node_modules/.bin/ember g initializer session
// app/initializers/session.js

export function initialize(application) {
  application.inject('controller', 'session', 'service:session');
  application.inject('route', 'session', 'service:session');
}

export default {
  initialize
};

Routing

Auto-Enabled Routes

By adding this addon into another application the sign-in, sign-out, and oauth route will automatically be included into your router.js at runtime. These routes can be invoked to sign-in and sign-out of the application, the oauth route is where AWS Cognito will redirect to after signing in/out.

Configure The application.js Route

The application that installs this addon must ensure that its app/routes/application.js extends the application route superclass provided by this addon. Here's how to do that:

// app/routes/application.js

import FleApplicationRoute from 'fle-ember-addon-data/routes/application';

export default class ApplicationRoute extends FleApplicationRoute {
  // ... the rest of your route here; e.g. initialize ember-intl
}

The secure Route

By default, Ember Simple Auth (ESA) that ships with this addon is configured to protect the route at and below /secure with authentication and authorization. The application that installs this addon should create the secure route:

./node_modules/.bin/ember g route secure

The secure route should extend the ESA AuthenticatedRouteMixin:

import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

export default class SecureRoute extends Route.extend(AuthenticatedRouteMixin) {
  get authenticationRoute() {
    return 'sign-in';
  }

  // ...
}

Translations

You should make sure to configure ember-intl accordingly. This addon ships with translations describing model column names, their help-block, placeholder, and tooltip text.

The wrapTranslationsWithNamespace should be set to true.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.